#include "leds.h"
#include <xc.h>

void initLEDs()
{
#ifdef LED_REV2
    TRISE = 0;
#else
    TRISBbits.TRISB2 = 0;
    TRISBbits.TRISB3 = 0;
    TRISBbits.TRISB4 = 0;
    TRISBbits.TRISB5 = 0;
#endif
}

void LED_SetGroup(int value)
{
#ifdef LED_REV2
    LATE = (LATE & ~0x7) | (value & 0x07);
#else
    LATB = (LATB & (~0x1C)) | (value << 2);
#endif
}

void LED_ToggleStatus()
{
#ifdef LED_REV2
//    LATEbits.LATE0 = ~LATEbits.LATE0;
//    LATEbits.LATE1 = ~LATEbits.LATE1;
//    LATEbits.LATE2 = ~LATEbits.LATE2;

    LATEbits.LATE3 = ~LATEbits.LATE3;
#else
    LATBbits.LATB5 = ~LATBbits.LATB5;
#endif
}